import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/index',
    children:[
      {path:'/index',component: ()=>import('../views/home/IndexView')},
      {path:'/reg',component: ()=>import('../views/home/RegView')},
      {path:'/login',component: ()=>import('../views/home/LoginView')},
      {path:'/purch',component: ()=>import('../views/home/puchase/PurchaseView')},
      {path:'/purch/list',component: ()=>import('../views/home/puchase/PurchaseListView')},
      {path:'/purch/out',component: ()=>import('../views/home/puchase/PurchaseReturnOrderView')},
      {path:'/purch/out/list',component: ()=>import('../views/home/puchase/PurchaseReturnOrderListView')},
      {path:'/sale',component: ()=>import('../views/home/sale/SalesVIew')},
      {path:'/sale/list',component: ()=>import('../views/home/sale/SalesListView')},
      {path:'/sale/remain',component: ()=>import('../views/home/sale/SalesRemainView')},
      {path:'/sale/remain/list',component: ()=>import('../views/home/sale/SalesRemainListVIew')},
      {path:'/ware',component: ()=>import('../views/home/ware/WarehouseInfoView')},
      {path:'/ware/in',component: ()=>import('../views/home/ware/WareInView')},
      {path:'/inWareTask',component: ()=>import('../views/home/ware/InWareTaskView')},
      {path:'/OutWareTask',component: ()=>import('../views/home/ware/OutWareTaskView')},
      {path:'/ware/in/list',component: ()=>import('../views/home/ware/WareInListView')},
      {path:'/ware/out',component: ()=>import('../views/home/ware/WareOutView')},
      {path:'/ware/out/list',component: ()=>import('../views/home/ware/WareOutListView')},
      {path:'/ware/transfer',component: ()=>import('../views/home/ware/WareTransferView')},
      {path:'/set/cust',component: ()=>import('../views/home/setting/CustManagementView')},
      {path:'/set/category',component: ()=>import('../views/home/setting/ProdCategoryManagementView')},
      {path:'/set/prod',component: ()=>import('../views/home/setting/ProdManagementView')},
      {path:'/set/supp',component: ()=>import('../views/home/setting/SuppManagementView')},
      {path:'/set/ware',component: ()=>import('../views/home/setting/WareManagementView')}
      // {path:'/detail',component: ()=>import('../views/home/DetailView')},
      // {path:'/list',component: ()=>import('../views/home/ListView')},
      // {path:'/personal',
      //   redirect:'/personal/info',
      //   component: ()=>import('../views/home/PersonalView'),
      //   children:[
      //     {path:'info',component: ()=>import('../views/home/personal/InfoView')},
      //     {path:'management',component: ()=>import('../views/home/personal/ManagementView')},
      //     {path:'post',component: ()=>import('../views/home/personal/PostView')}
      //   ]
      // }
    ]
  },{
    path: '/test',
    name: 'test',
    component: ()=>import('../views/TestView')
  }

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router